﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using System.Linq.Expressions;

namespace SemPlayGen.Repository
{
    public interface IRepository<T> where T : EntityObject
    {
        bool Insert(T entity);
        bool Update(T entity);
        bool Delete(T entity);
        T GetSingle(Expression<Func<T, bool>> whereCondition);
        IEnumerable<T> GetAll<TKeyType>(Expression<Func<T, TKeyType>> keySortingSelector, SortingMode sortingMode);
        IEnumerable<T> FindAll<TKeyType>(Expression<Func<T, bool>> whereCondition, Expression<Func<T, TKeyType>> keySortingSelector, SortingMode sortingMode);
    }

    public enum SortingMode { ascending, descending }
}